<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/custom/custom/Base_DefectItem.js此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/Ware/Ware_Reservoir.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'ReserId',
            footer: "Foots",
            cnName: '库区管理',
            name: 'Ware/Ware_Reservoir',
            url: "/Ware_Reservoir/",
            sortName: "CreateDate"
        });
        const editFormFields = ref({ "ReserName": "", "ReserCode": "", "ReserSqure": "", "WareId": "", "ReserNum": "", "ReseNote": ""});
        const editFormOptions = ref([[{ "title": "库区编号", "field": "ReserCode", "type": "text" }],
        [{ "title": "库区名称", "required": true, "field": "ReserName", "type": "text" }]
            , [{ "title": "面积", "required": true, "field": "ReserSqure", "type": "text" }]
            , [{"dataKey":"Ware_ReservoirWareId","data":[],"title":"所属仓库","field":"WareId","type":"select"}]
            , [{ "title": "库位数量", "required": true, "field": "ReserNum", "type": "text" }]
            , [{ "title": "备注", "field": "ReseNote", "type": "textarea" }]]);
        const searchFormFields = ref({ "ReserName": "", "ReserCode": "", "ReserSqure": "", "WareId": "", "ReserNum": "", "ReseNote": ""});
        const searchFormOptions = ref([[{ "title": "库区编号", "field": "ReserCode", "type": "like" }]
            ,[ { "title": "库区名称", "field": "ReserName", "type": "like" }]
            , [{ "title": "面积", "field": "ReserSqure", "type": "like" }]
            ,[ {"dataKey":"Ware_ReservoirWareId","data":[],"title":"所属仓库","field":"WareId","type":"select"}]
            ,[ { "title": "库位数量", "field": "CreatReserNumor", "type": "like" }]
            ,[ { "title": "备注", "field": "ReseNote", "type": "like" }]]);
        const columns = ref([{ field: 'ReserId', title: '库区管理主键', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'ReserCode', title: '库区编号', type: 'string', sort: true, width: 180, align: 'left', sort: true },
        { field: 'ReserName', title: '库区名称', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' },
        { field: 'ReserSqure', title: '面积', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' },
        { field: 'WareId',title:'所属仓库',type:'string',bind:{ key:'Ware_ReservoirWareId',data:[]},width:120,align:'left'},
        { field: 'ReserNum', title: '库位数量', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' },
        { field: 'ReseNote', title: '备注', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' }]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
